import 'package:fate_blind_box/routes/page_route_names.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';

import 'state.dart';

class IdentityVerifyLogic extends GetxController {
  final IdentityVerifyState state = IdentityVerifyState();

  /// 验证支付密码
  verifyPayPassword(String payPassword) {
    if (payPassword != '123456') {
      EasyLoading.showToast('支付密码错误，请重新输入');
      return;
    }

    /// 跳转到设置支付密码页面
    Get.offAndToNamed(PageRouteNames.setPaymentPassword);
  }

  /// 忘记密码,重新设置支付密码
  void faceVerification() async {
    FocusScope.of(Get.context!).unfocus();
    Get.offAndToNamed(PageRouteNames.setPaymentPassword);
    // var manager = FaceVerifyManager();
    //
    // Map<String, dynamic> verificationResult =
    // await manager.performFaceVerification();
    // if (verificationResult['success']) {
    //   debugPrint("验证成功");
    //   HzNavigator.push(SettingRouter.setPayPasswordPage, arguments: {
    //     "status": PasswordStatus.forgot,
    //     'signature': verificationResult['signature'],
    //   });
    // }
  }
}
